package com.openlab.service.car.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.openlab.service.car.dto.UserCarDto;
import com.openlab.service.car.entity.UserCar;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserCarMapper extends BaseMapper<UserCar> {
    @Select(
            "select  car_number, " +
                    "wechat_mp_user_id, " +
                    "building_id " +
                    "from ejyy_user_car " +
                    "where ejyy_user_car.car_number = #{car_number} " +
                    "and " +
                    "where ejyy_user_car.wechat_mp_user_id = #{wechat_mp_user_id} " +
                    "and " +
                    "where ejyy_user_car.building_id = # {building_id}"
    )
    List<UserCarDto> selectCarMessage(@Param("car_number") String car_number,
                                      @Param("wechat_mp_user_id") Long wechat_mp_user_id,
                                      @Param("building_id") Long building_id);
}
